<!DOCTYPE html>
<!--
==========================================================================
LV自动生成列表页面代码,只生成一次,按需修改.
生成日期：2024-01-03 21:50:54 +0800 CST
生成路径: template/mywork/task/list.html
生成人：lv
==========================================================================
-->
<html lang="zh">
<head>
    {{template "header" (OssUrl)}}
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>    
                        <li>
                            <p>工号：</p>
                            <input type="text" name="username"/>
                        </li>
                            
                        <li>
                            <p>密码：</p>
                            <input type="text" name="password"/>
                        </li>
                            
                        <li>
                            <p>项  目  号：</p>
                            <input type="text" name="prjCode"/>
                        </li>
                            
                        <li>
                            <p>任务内容：</p>
                            <input type="text" name="taskContent"/>
                        </li>
                                                
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            {{getPermiButton .uid "mywork:task:add" "$.operate.addFull()" "新增" "btn btn-success" "fa fa-plus"}}
            {{getPermiButton .uid "mywork:task:edit" "$.operate.editFull()" "修改" "btn btn-primary single disabled" "fa fa-edit"}}
            {{getPermiButton .uid "mywork:task:remove" "$.operate.removeAll()" "删除" "btn btn-danger multiple disabled" "fa fa-remove"}}
            {{getPermiButton .uid "mywork:task:export" "$.table.exportExcel()" "导出" "btn btn-warning" "fa fa-download"}}
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
{{template "footer" (OssUrl)}}
<script type="text/javascript">
    var editFlag = '{{hasPermi .uid "mywork:task:edit"}}';
    var removeFlag = '{{hasPermi .uid "mywork:task:remove"}}';

                         var statusDatas = {{getDictTypeData "sys_normal_disable"}};              
    var prefix = ctx + "/mywork/task";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit?id={id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "task",
            columns: [
                {
                    checkbox: true
                },  
                {
                    field: 'id',
                    title: '',
                    visible: false
                },     
                {
                    field: 'username',
                    title: '工号'
                },      
                {
                    field: 'password',
                    title: '密码'
                },      
                {
                    field: 'prjCode',
                    title: '项  目  号'
                },      
                {
                    field: 'taskContent',
                    title: '任务内容'
                },      
                {
                    field: 'startDate',
                    title: '开始日期'
                },      
                {
                    field: 'endDate',
                    title: '结束日期'
                },      
                {
                    field: 'workDays',
                    title: '本月工时'
                },      
                {
                    field: 'autoSubmit',
                    title: '自动提交'
                },      
                {
                    field: 'status',
                    title: '任务状态',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(statusDatas, value);
                    }
                },       
                {
                    field: 'sort',
                    title: '排序，大的优先'
                },              
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>